<?php
   	
    include('db_connect.php');

	$testquery='select count(feedback.id) as anzahl,thema.bezeichnung from Feedback join thema on feedback.thema=thema.id where
	STR_TO_DATE( Eintragungsdatum, "%Y-%m-%d" ) >= STR_TO_DATE( "' . $_POST['von'] . '", "%Y-%m-%d" ) 
	AND 
	STR_TO_DATE( Eintragungsdatum, "%Y-%m-%d" ) <= STR_TO_DATE( "' . $_POST['bis'] . '", "%Y-%m-%d" ) group by thema.bezeichnung order by anzahl desc';
	$result=mysql_query($testquery);
	$array = null;

	$i=0;
	while($row = mysql_fetch_array($result)){
		$array[$i] = $row;
		$i++;
	}

	print json_encode($array);





?>